<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function Star(uname, age, sex) {
            this.uname = uname;
            this.age = age;
            this.sex = sex;
        }
        Star.prototype = {
            // 如果修改了原来的原型对象，给原型对象赋值的是一个对象，则必须手动的利用constructor指回原来的构造函数
            // constructor: Star,
            sing: function () {
                console.log('唱歌');
            },
            movie: function () {
                console.log('演电影');
            },
        }
        Star.prototype.constructor = Star;
        const ldh = new Star('刘德华', 20, '男');
        ldh.movie()
        console.log(Star.prototype);
        console.log(ldh.__proto__);
        console.log(Star.prototype.constructor);
        console.log(ldh.__proto__.constructor);
    </script>
</body>0.0 
</html




















.>